import { BaseModel } from '../base-model'
import { RoleMenu } from '@/entity/system/role'
import { Dept } from '@/entity/system/dept'
import { menu } from '@/entity/system/menu'

export interface userLogin {
  account: string
  captcha: string
  password: string
}

export interface userRegistry {
  deptId?: number
  email: string
  mobile: string
  name: string
  nickName?: string
  status?: number
}

export interface user extends BaseModel {
  account?: string
  name?: string
  nickName?: string
  avatar?: string
  password?: string
  salt?: string
  email?: string
  mobile?: string
  status?: number
  deptId?: string
  userRole: Array<UserRole> | Array<string>
  userRoles?: Array<role>
  dept?: Dept
  sysMenu?: menu
  sysMenuTree?: menu
  userType?: string
  [key: string]: any
}

export interface role extends BaseModel {
  name?: string
  remark?: string
  sysRoleMenus?: Array<RoleMenu>
  menu?: Array<menu>
  menuTree?: Array<menu>
}

export interface UserRole extends BaseModel {
  // 用户id
  roleId?: string
  // 角色id
  userId?: string
}
